package java9;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class MapTest {
    public static void main(String[] args) {
        Map<String,Integer> map1=new HashMap<>();
        map1.put("one",1);
        map1.put("two",2);
        System.out.println(map1);

        //java9之后 使用集合类的快速工厂方法
        Map<String, Integer> map = Map.of("a", 18, "b", 20);
        System.out.println(map.get("a"));

        Set<String> set = Set.of("c", "b", "a");
        System.out.println(set);

        List<String> list = List.of("a", "b", "c", "d");
        System.out.println(list);
    }
}
